package org.example.crm.dao;

import org.apache.ibatis.annotations.Mapper;
import org.example.crm.base.BaseMapper;
import org.example.crm.model.Permission;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface PermissionMapper extends BaseMapper<Permission, Integer> {

    Integer selectRoleCountByPrimaryKey(Integer roleId);

    void deleteByRoleId(Integer roleId);

    List<Integer> queryRoleModuleIdsByRoleId(Integer roleId);

    //通过用户id查询对应的资源的资源权限码列表
    List<String> queryUserHasRoleHasPermissionByUserId(Integer userId);

    Integer selectByModuleId(Integer id);

    Integer deleteByModuleId(Integer id);
}